package com.bocloud.cmp.driver.providers.intf;

import com.bocloud.cmp.model.OSMigrateModel;
import com.bocloud.cmp.model.ServerModel;
import com.bocloud.cmp.model.SnapshotModel;
import com.bocloud.common.model.BsmResult;

/**
 * 虚拟机操作服务接口
 * 
 * @author weiwei
 *
 */
public interface ServerProvider {

    /**
     * 虚拟机列表
     * 
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult list(String vendor, String region);

    /**
     * 创建虚拟机
     * 
     * @param vendor
     * @param region
     * @param server
     * @return
     */
    public BsmResult create(String vendor, String region, ServerModel server);

    /**
     * 更新虚拟机
     * 
     * @param vendor
     * @param region
     * @param server
     * @return
     */
    public BsmResult modify(String vendor, String region, ServerModel server);

    /**
     * 虚拟机迁移
     * 
     * @param vendor
     * @param region
     * @param server
     * @return
     */
    public BsmResult migrate(String vendor, String region, ServerModel server);

    /**
     * 虚拟机迁移
     * 
     * @param vendor
     * @param region
     * @param OSMigrate
     * @return
     */
    public BsmResult OSMigrate(String vendor, String region, OSMigrateModel OSMigrate);

    /**
     * 删除虚拟机
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult remove(String instanceId, String vendor, String region);

    /**
     * 虚拟机详细
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult detail(String instanceId, String vendor, String region);

    /**
     * 启动虚拟机
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult start(String instanceId, String vendor, String region);

    /**
     * 停止虚拟机
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult stop(String instanceId, String vendor, String region);

    /**
     * 重启虚拟机
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult reboot(String instanceId, String vendor, String region);

    /**
     * 挂起虚拟机
     * 
     * @param instanceId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult suspend(String instanceId, String vendor, String region);

    /**
     * 加入安全组
     * 
     * @param instanceId
     * @param group
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult joinSGroup(String instanceId, String group, String vendor, String region);

    /**
     * 离开安全组
     * 
     * @param instanceId
     * @param group
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult leaveSGroup(String instanceId, String group, String vendor, String region);

    /**
     * 创建快照
     * 
     * @param snapshotModel
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult snapshot(SnapshotModel snapshotModel, String vendor, String region);

    /**
     * console接口
     * 
     * @param type:
     *            novnc and xvpvnc
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult VNCConsole(String vncType, String serverId, String vendor, String region);

    /**
     * 恢复
     * 
     * @param serverId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult resume(String serverId, String vendor, String region);
    
    /**
     * 恢复
     * 
     * @param serverId
     * @param vendor
     * @param region
     * @return
     */
    public BsmResult unpause(String serverId, String vendor, String region);
}
